﻿<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>GD库函数综合使用实例</title>
</head>
<body>
<?php
	header('Content-type: image/jpeg');
	$im = imagecreatefromjpeg("1.jpg");
	// 取得一点的颜色
	$start_x = 40;
	$start_y = 50;
	$color_index = imagecolorat($im, $start_x, $start_y);
	// 使其可读
	$color_tran = imagecolorsforindex($im, $color_index);
	// 显示该颜色的值
	echo '<pre>';
	print_r($color_tran);
	echo '</pre>';

?>
</body>
</html>